<?php
//计算输出指定年月有多少天
$year = date('Y');
$month = date('m');
$days = match ($month) {
    4, 6, 9, 11 => 30,
    2 => $year % 400 == 0 || $year % 4 == 0 && $year % 100 != 0 ? 29 : 28,
    default => 31
};
printf("%d年%d月有%d天", $year, $month, $days);

$ws = match (date('w')) {
    '0' => "星期日",
    '1' => "星期一",
    '2' => "星期二",
    '3' => "星期三",
    '4' => "星期四",
    '5' => "星期五",
    default => "星期六",
};
printf("<br>今日是：%s", $ws);